﻿using ReaderWriter.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReaderWriter.Providers
{
   public   interface IReaderWriter
    {
        FolderNode GetRoot();
        FolderNode Up(string uri);
        List<FolderNode> GetFolders(FolderNode root);
        List<FolderNode> GetFolders(string uri, bool recurse, int level=0);
        List<StorageNode> GetAllNodes(string uri);
        List<FileNode> GetFiles(FolderNode parent);
        FolderNode GetFolder(string uri);
        FileNode GetFile(string uri, bool fillWithContent = false);


        FileNode CreateFile(FolderNode parent, FileNode file, bool overriteProperties = true);
        FolderNode CreateFolder(FolderNode parent, FolderNode child, bool overriteProperties = true);

        FileNode WriteFile(FileNode file);
        FileNode ReadFile(FileNode file);

        bool IsFolderExist(FolderNode folder);
        bool IsFileExist(FileNode file);

        bool DeleteFile(FileNode file);
        bool RemoveFolder(FolderNode folder);

        string Execute(string uri);
        //string GetRootedFileName(string uri);
    }
}
